program main

!----------------------------------------------------------------
!
!     V1. ORIGINAL CODE BY DR OZGUR EKICI (12/06/07):
!     energy eqn. solver for Au nanosphere
!     laser heated in water solution
!
!     This version is a complete overhaul of ozgur's original.  
!     Basically, all that remains are the material properties.
!
!     V2. MODIFICATION BY SIGFRIED HAERING (06/2011):
!     - updated to F90 format
!     - converted to module format
!     - changed to RK4 w/central difference
!     - variable parameter read-in
!     - converted tophat pulse to gaussian
!     - user specificed options:
!       * electron emission by multiphoton and 
!         thermionic processes
!       * enforce energy conservation for heating
!         process with electron emission
!       * consider latent heat of melting
!       * consider particle-water conductance
!         change due to explosive boiling (needs work)
!       * pulse trains at specifice rep. rate
!    - numerous other small changes
!
!    Options/parameters controlled in ns_param.txt, do no delete
!    or modify the format of this file, only the values.  Code 
!    executed through shell script (*.sh).  If not using gfortran
!    compiler, modify FF variable in the makefile.  For theory and 
!    equations, refer to my master's thesis.
! 
!    ADDITIONAL MODIFICATIONS BY (?) (date):
!
!    Though I am NOT the maintainer of this code, feel free 
!    to refer questions/comments to haerings@gmail.com .  If
!    bugs/errors are discovered, please notify me as well.
!
!    Additional contact information: (?)
!
!----------------------------------------------------------------


  ! load modules	  
  use globals
  use space
  use write_results 
  use emit
  use time_int
  
  implicit none

  ! read parameter input
  call read_param     

  ! location of cell vertices, non-uniform grid
  call grid           

  ! initialize output files
  call file_ini       

  if (erun) then
     ! read Qnf for sphere
     call read_qnf
     ! read fowler function results file
     call read_fowler 
  endif

  ! begin integration -> bulk of program here
  call time_step      

  ! clean-up  
  call close_files    
  if (erun) then
     call deallocate_emission
  endif

!----------------------------------------------------------------

end program main
         
